package com.wjx.admin_consumer.service;

import com.wjx.admin_consumer.model.Appointment;
import com.wjx.admin_consumer.model.Rating;
import com.wjx.admin_consumer.model.Serve;
import com.wjx.admin_consumer.model.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;
import java.util.List;

@Component
@FeignClient(name = "admin-provider", fallback = AdminServiceFallback.class)
public interface AdminService {
    @PostMapping("/admin-queryAllAppointment")
    public List<Appointment> queryAllAppointment()   ;
    @PostMapping("/admin-queryServiceById")
    public Serve queryServiceById(@RequestParam("id") int id)   ;
    @PostMapping("/admin-queryUserById")
    public User queryUserById(@RequestParam("id") int id)   ;
    @PostMapping("/admin-queryAppointmentById")
    public Appointment queryAppointmentById(@RequestParam("id") int id)   ;
    @PostMapping("/admin-queryServiceByName")
    public Serve queryServiceByName(@RequestParam("serviceName") String serviceName)   ;
    @PostMapping("/admin-selectUserByUsername")
    public User selectUserByUsername(@RequestParam("username") String username)   ;
    @PostMapping("/admin-updateAppointmentById")
    public int updateAppointmentById(@RequestParam("id") int id,@RequestParam("userId") int userId,
                          @RequestParam("serviceId") int serviceId, @RequestParam("appointmentTime") String appointmentTime,
                          @RequestParam("appointmentLocation")  String appointmentLocation, @RequestParam("phone") String phone,
                          @RequestParam("status") String status,@RequestParam("lastUpdatedTime") String lastUpdatedTime)  ;
    @PostMapping("/admin-deleteRatingByAppointmentId")
    public int deleteRatingByAppointmentId(@RequestParam("id") int id)   ;
    @PostMapping("/admin-deleteAppointmentById")
    public int deleteAppointmentById(@RequestParam("id") int id)   ;
    @PostMapping("/admin-queryAppointmentByUserId")
    public List<Appointment> queryAppointmentByUserId(@RequestParam("id") int id)  ;
    @PostMapping("/admin-queryAppointmentByServiceId")
    public List<Appointment> queryAppointmentByServiceId(@RequestParam("id") int id)  ;
    @PostMapping("/admin-queryLikeAppointment")
    public List<Appointment> queryLikeAppointment(@RequestParam("keyword") String keyword)  ;
    @PostMapping("/admin-queryAllUser")
    public List<User> queryAllUser()  ;
    @PostMapping("/admin-queryLikeUsername")
    public List<User> queryLikeUsername(@RequestParam("keyword") String keyword)  ;
    @PostMapping("/admin-updateUserById")
    public int updateUserById(@RequestParam("id") int id,
                              @RequestParam("username") String username,
                              @RequestParam("password") String password,
                              @RequestParam("authority") String authority)   ;
    @PostMapping("/admin-deleteAppointmentByUserId")
    public int deleteAppointmentByUserId(@RequestParam("id") int id)  ;
    @PostMapping("/admin-deleteRatingByUserId")
    public int deleteRatingByUserId(@RequestParam("id") int id)  ;
    @PostMapping("/admin-deleteUserById")
    public int deleteUserById(@RequestParam("id") int id)  ;
    @PostMapping("/admin-showService")
    public List<Serve> showService()  ;
    @PostMapping("/admin-search")
    public List<Serve> search( @RequestParam("keyword") String keyword)  ;
    @PostMapping("/admin-updateServiceById")
    public int updateServiceById(@RequestParam("id") int id,@RequestParam("name") String name,
                                 @RequestParam("description") String description,
                                 @RequestParam("price")double  price)  ;
    @PostMapping("/admin-deleteAppointmentByServiceId")
    public int deleteAppointmentByServiceId(@RequestParam("id") int id)  ;
    @PostMapping("/admin-deleteRatingByServiceId")
    public int deleteRatingByServiceId(@RequestParam("id") int id)  ;
    @PostMapping("/admin-deleteServiceById")
    public int deleteServiceById(@RequestParam("id") int id)  ;
    @PostMapping("/admin-insertService")
    public int insertService(@RequestParam("name") String name,
                             @RequestParam("description") String description,
                             @RequestParam("price") double price)  ;
    @PostMapping("/admin-queryAllRating")
    public List<Rating> queryAllRating()  ;
    @PostMapping("/admin-queryRatingByUserId")
    public List<Rating> queryRatingByUserId(@RequestParam("id") int id)  ;
    @PostMapping("/admin-queryRatingByServiceId")
    public List<Rating> queryRatingByServiceId(@RequestParam("id") int id)  ;
    @PostMapping("/admin-queryLikeRating")
    public List<Rating> queryLikeRating(@RequestParam("keyword") String keyword)  ;
    @PostMapping("/admin-deleteRatingById")
    public int deleteRatingById(@RequestParam("id") int id)  ;
    @PostMapping("/admin-register")
    public int register(@RequestParam("username") String username,
                        @RequestParam("password") String password,
                        @RequestParam("authority")String authority)  ;

}
